# VCS
YS_VCS_PROMPT_PREFIX1="%{$fg[yellow]%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"

# Git info
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"

local emulate_zsh_info='$(emulate_zsh)'
emulate_zsh() {
  if [ $DISABLE_AUTO_EMU = 'true' ]; then
    echo -E "EMU=OFF|$(emulate) "
  else
    echo ""
  fi
}


local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"

# Prompt format:
#
# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE
# $ COMMAND
#
# For example:
#
# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] C:0
# $
PROMPT="
%{$fg_bold[red]%}${emulate_zsh_info}\
%{$fg_bold[cyan]%}%n\
%{$fg[white]%}@\
%{$fg[green]%}%m\
%{$fg[white]%}:\
%{$terminfo[bold]$fg_bold[blue]%}%~%{$reset_color%}\
${git_info}\
 \
$exit_code
%{$terminfo[bold]$fg[cyan]%}>%{$reset_color%} "

